#coding:utf-8
'''
Created on 2018年5月2日

@author: 97234
'''
import logging

class TestLogging(object):
    def __init__(self):
        logFormat = '%(asctime)-12s %(levelname)-8s %(name)-10s %(message)-12s'
        logFileName = './testLog.txt'
        
        logging.basicConfig(level  = logging.INFO,
                            format = logFormat,
                            filename = logFileName,
                            filemode = 'w')
        
        logging.debug('debug message')
        logging.info('info message')
        logging.warning('warning message')
        logging.error('error message')
        logging.critical('critical message')
        
        
if __name__ == '__main__':
    tl = TestLogging
        